package erp.education.web.action.setup.school;

import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;

import erp.education.client.setup.school.SchoolRegRequest;
import erp.education.server.beans.interfaces.setup.school.SchoolRegisterServiceI;
import erp.education.web.common.BaseAction;

public class SchoolRegisterAction extends BaseAction implements
		ModelDriven<SchoolRegRequest> {
	@Autowired
	SchoolRegRequest schoolRegRequest;
	@Autowired
	SchoolRegisterServiceI schoolRegisterService;

	public String schoolRegister() throws Exception {

		this.result = schoolRegisterService.schoolRegisterLoadService(
				schoolRegRequest).getResponseObject();
		getRequest().setAttribute("result", this.result.getResultList());

		return "schoolregister";
	}

	public String saveUpdateSchoolDetails() throws Exception {
		this.result = schoolRegisterService.saveUpdateSchoolDetails(
				schoolRegRequest).getResponseObject();

		return "schoolregister";
	}

	@Override
	public SchoolRegRequest getModel() {
		return this.schoolRegRequest;
	}
}
